feat(harness): allow disabling general-purpose subagent - #2354
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
oss-maintainer
left a comment
There was a problem hiding this comment.
Review: PR #2354 — feat(harness): allow disabling general-purpose subagent
Verdict: Approved ✅
Adds a disableGeneralPurposeSubagent() builder method that allows users to opt out of the built-in general-purpose subagent while keeping declared and custom subagents available.
Changes:
- New boolean flag
disableGeneralPurposeSubagentin the Builder - Conditional registration in
buildSubagentEntries()andbuildStaticSubagentEntries()— the general-purpose entry is skipped when the flag is set - Test coverage verifies the flag works correctly
Useful for users who want to restrict subagent capabilities to only explicitly declared ones, reducing the attack surface and resource usage.
All CI checks pass.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR adds a new builder option disableGeneralPurposeSubagent() to HarnessAgent.Builder, allowing users to suppress the built-in "general-purpose" subagent while keeping declared (markdown) and custom (programmatic) subagents available. The change is applied symmetrically to both static and dynamic paths. The change is clean, follows the existing disable*() builder pattern, and has no behavioral impact on existing users.
| } | ||
|
|
||
| /** | ||
| * Disables the built-in {@code general-purpose} subagent while keeping declared and custom |
There was a problem hiding this comment.
[nitpick] Consider adding a note that this flag has no effect when disableSubagents() is also set, since the entire subagent subsystem is skipped at a higher level.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR adds a new builder option disableGeneralPurposeSubagent() to HarnessAgent.Builder, allowing users to suppress the built-in "general-purpose" subagent while keeping declared (markdown) and custom (programmatic) subagents available. The change is applied symmetrically to both static and dynamic paths. The change is clean, follows the existing disable*() builder pattern, and has no behavioral impact on existing users.
| } | ||
|
|
||
| /** | ||
| * Disables the built-in {@code general-purpose} subagent while keeping declared and custom |
There was a problem hiding this comment.
[nitpick] Consider adding a note that this flag has no effect when disableSubagents() is also set, since the entire subagent subsystem is skipped at a higher level.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR adds a new builder option disableGeneralPurposeSubagent() to HarnessAgent.Builder, allowing users to suppress the built-in "general-purpose" subagent while keeping declared (markdown) and custom (programmatic) subagents available. The change is applied symmetrically to both static and dynamic paths. The change is clean, follows the existing disable*() builder pattern, and has no behavioral impact on existing users.
| } | ||
|
|
||
| /** | ||
| * Disables the built-in {@code general-purpose} subagent while keeping declared and custom |
There was a problem hiding this comment.
[nitpick] Consider adding a note that this flag has no effect when disableSubagents() is also set, since the entire subagent subsystem is skipped at a higher level.
AgentScope-Java Version
2.0.1-SNAPSHOT
Description
HarnessAgent always registers the built-in
general-purposesubagent when subagent support is enabled. This can interfere with explicitly declared subagents by allowing the built-in agent to handle tasks intended for them.This change adds
disableGeneralPurposeSubagent()to disable only the built-in entry while keeping programmatic, workspace-defined, and custom subagents available. Both static and dynamic subagent registration paths honor the new option.Fixes #2340
Checklist
mvn spotless:apply